package cc.rengu.igas.bomp.common.enums;

import java.io.Serializable;

/**
 * 间联商户类别枚举类
 * Created by 王成 on 2018/5/31.
 * Updated by zhangxuran on 2020/04/22
 */
public enum MchntTypeEnum implements Serializable {
    NORMAL_MCHNT("00", "普通商户"),
    CHAIN_MCHNT("10", "连锁商户"),
    CHAIN_MCHNT_STORE("11", "连锁商户门店"),
    WECHAT_MCHNT("20", "小微商户"),
    ;
    private String mchntType;
    private String mchntDesc;

    MchntTypeEnum(String mchntType, String mchntDesc) {
        this.mchntType = mchntType;
        this.mchntDesc = mchntDesc;
    }

    public String getMchntType() {
        return mchntType;
    }

    public void setMchntType(String mchntType) {
        this.mchntType = mchntType;
    }

    public String getMchntDesc() {
        return mchntDesc;
    }

    public void setMchntDesc(String mchntDesc) {
        this.mchntDesc = mchntDesc;
    }

    /*
     * 根据商户类型编码查询商户类型信息
     * @params mchntType 商户类型编码
     * return 商户类型
     */
    public static String getMchntDescBymchntType(String mchntType) {
        for (MchntTypeEnum mchntTypeEnum : MchntTypeEnum.values()) {
            if (mchntTypeEnum.getMchntType().equals(mchntType)) {
                return mchntTypeEnum.getMchntDesc();
            }
        }
        return null;
    }
}
